package com.syni.mdd.sjb.common.component.mybatis.community.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 数据宝企业微信群聊信息表
 *
 * @author wangbaitao
 * @Date 2021-02-22
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SjbQywxChatGroupInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键Id
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;
    /**
     * 客户群ID
     */
    private String chatId;
    /**
     * 群名
     */
    private String name;
    /**
     * 群主ID
     */
    private String owner;
    /**
     * 群的创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    /**
     * 群公告
     */
    private String notice;
    /**
     * 同步时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime syncTime;
    /**
     * 群成员列表,字段信息和sjb_qywx_chat_group_ref表保持一致
     */
    private String memberList;
    /**
     * 客户群跟进状态。0 - 跟进人正常，1 - 跟进人离职，2 - 离职继承中，3 - 离职继承完成
     */
    private String status;
    /**
     * 企业id
     */
    private String corpId;
    /**
     * 群主名称
     */
    @TableField(exist = false)
    private String ownerName;
    /**
     * 群聊大小
     */
    @TableField(exist = false)
    private Integer size = 0;
    /**
     * 成员列表
     */
    @TableField(exist = false)
    private List<SjbQywxChatGroupRef> userInfos;
    /**
     * 统计数据
     */
    @TableField(exist = false)
    private SjbChatCountDetails countArr;

    public static final String ID = "id";
    public static final String CHAT_ID = "chat_id";
    public static final String NAME = "name";
    public static final String OWNER = "owner";
    public static final String CREATE_TIME = "create_time";
    public static final String NOTICE = "notice";
    public static final String MEMBER_LIST = "member_list";
    public static final String SYNC_TIME = "sync_time";
    public static final String CORP_ID = "corp_id";
    public static final String STATUS = "status";
}